<?php

# PMB Online
# Aplikasi PMB Online untuk Pendaftaran Calon Mahasiswa di PT/PTS Indonesia
# 
# version 1.0
# class input_form
# file
# created Feb 7, 2013 2:23:17 AM
# 
# (c)2012, arif.laksito@gmail.com

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
?>
<h3><?php echo $head?></h3>
<ul class="breadcrumb">
    <li>PMB Online <span class="divider">/</span></li>  
    <li>Data Pendaftar <span class="divider">/</span></li>
    <li><?php echo $head?></li>
</ul>

<script>
    $(function() {
        $( "#date1, #date2" ).datepicker({
            changeMonth: true,
            changeYear: true,
            yearRange: "c-60:c+0",
            dateFormat: "yy-mm-dd"
        });
    });
</script>

<?php if (isset($msg)): ?>
    <div class="<?php echo ($sts) ? 'alert alert-success' : 'alert alert-error' ?>">
        <?php echo $msg ?>
    </div>
<?php endif ?>

<form action="" method="post" class="ins">
    <div class="row">
        <div class="span5">        
            <label>Jenis Pendaftaran</label>
            <label class="radio"> 
                <input type="radio" name="status_daftar" value="0" <?php if ($post['status_daftar'] == 0) echo "checked='checked'" ?>/> Reguler <br />
                <input type="radio" name="status_daftar" value="1" <?php if ($post['status_daftar'] == 1) echo "checked='checked'" ?>/> Pindahan <br />
                <input type="radio" name="status_daftar" value="2" <?php if ($post['status_daftar'] == 2) echo "checked='checked'" ?>/> CSR
            </label>

            <label>Pilihan D3</label>            
            <select name="jur_d3">
                <option value="">Pilih Jurusan D3..</option>
                <?php foreach ($d3 as $d): ?>      
                    <?php $c = ($post['jur_d3']==$d['jenjang'] . '-' . $d['nama_jurusan'])?"selected='selected'":''?>
                    <option <?php echo $c?> value="<?php echo $d['jenjang'] . '-' . $d['nama_jurusan'] ?>"> 
                        <?php echo $d['jenjang'] . '-' . $d['nama_jurusan'] ?>
                    </option>
                <?php endforeach ?>     
            </select>            

            <label>Pilihan S1</label>
            <select name="jur_s1">
                <option value="">Pilih Jurusan S1..</option>
                <?php foreach ($s1 as $s): ?>
                    <?php $d = ($post['jur_s1']==$s['jenjang'] . '-' . $s['nama_jurusan'])?"selected='selected'":''?>
                    <option <?php echo $d?> value="<?php echo $s['jenjang'] . '-' . $s['nama_jurusan'] ?>">
                        <?php echo $s['jenjang'] . '-' . $s['nama_jurusan'] ?>
                    </option>    
                <?php endforeach ?>            
            </select>
            
            <label>Nama Lengkap*</label>
            <input type="text" name="nama_lengkap" value="<?php echo $post['nama_lengkap'] ?>" class="input-xlarge"/>

            <label>Tempat/Tgl Lahir*</label>
            <input type="text" name="tempat_lahir" value="<?php echo $post['tempat_lahir'] ?>"/>
            <input type="text" id="date1" class="input-small" name="tgl_lahir" value="<?php echo $post['tgl_lahir'] ?>"/> 

            <label>Jenis Kelamin</label>
            <label class="radio">
                <?php foreach ($jkel as $k => $jk): ?>
                    <input type="radio" name="jkel" value="<?php echo $k ?>" <?php echo ($post['jkel'] == $k) ? "checked='checked'" : "" ?>/> <?php echo $jk ?> <br />
                <?php endforeach ?>                
            </label>            
            
        </div>
        <div class="span5">
            
            <label>Tahun Lulus</label>
            <input type="text" class="input-small" name="th_lulus" value="<?php echo $post['th_lulus'] ?>"/>
            
            <label>Rata-rata NEM/IPK</label>
            <input type="text" class="input-small" name="nem" value="<?php echo $post['nem'] ?>"/>

            <label>Jurusan Sekolah</label>
            <select name="jurusan">
                <option value="">Pilih Jurusan Sekolah</option>
                <option value="IPA" <?php if($post['jurusan']=='IPA') echo "selected='selected'"?>>IPA</option>
                <option value="IPS" <?php if($post['jurusan']=='IPS') echo "selected='selected'"?>>IPS</option>
                <option value="Bahasa" <?php if($post['jurusan']=='Bahasa') echo "selected='selected'"?>>Bahasa</option>
                <option value="Lainnya" <?php if($post['jurusan']=='Lainnya') echo "selected='selected'"?>>Lainnya</option>
            </select>            
            
            <label>Tgl Ujian</label>            
            <?php $d = ($post['tgl_ujian']=='')?date('Y-m-d'):$post['tgl_ujian']?>
            <input type="text" id="date2" class="input-small" name="tgl_ujian" value="<?php echo $d?>"/> 
            
            <label>Kelengkapan Data</label>
            <label class="checkbox">
                <input type="checkbox" name="kelengkapan" value="1" <?php if($post['kelengkapan']==1) echo "checked='checked'"?>/> Syarat Kelengkapan <br />
                <input type="checkbox" name="biaya_daftar" value="1" <?php if($post['biaya_daftar']==1) echo "checked='checked'"?>/> Biaya Pendaftaran
            </label>
            
            <label></label>
            <small>Field dengan tanda * wajib diisikan</small>

            <br /><br />
            <button type="submit" class="btn btn-primary"><i class="icon-file"></i> Simpan Data</button>  
            <?php if($this->uri->segment(2)=='edit'):?>
            <a href="<?php echo base_url('apps/edit/'.$this->uri->segment(3).'/detail') ?>" class="btn btn-success">Form Lengkap</a>
            <?php else:?>
            <a href="<?php echo base_url('apps/input/detail') ?>" class="btn btn-success">Form Lengkap</a>
            <?php endif?>

        </div>
    </div>    
</form>    